﻿using JESAI.DynamicWebApi.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JESAI.DynamicWebApi.Configurations
{
    public class DynamicWebApiControllerAssemblySettingList:List<DynamicWebApiControllerAssemblySetting>
    {
        /// <summary>
        /// 从配置集合里面获取当前程序集的控制器配置信息。
        /// </summary>
        /// <param name="controllerType">控制器类型</param>
        /// <returns>返回指定控制器的配置信息</returns>
        public List<DynamicWebApiControllerAssemblySetting> GetSettings(Type controllerType)
        {
            return this.Where(controllerSetting => controllerSetting.Assembly == controllerType.GetAssembly()).ToList();
        }
    }
}
